# Contributor: Jake Buchholz Göktürk <tomalok@gmail.com>
# Maintainer: Jake Buchholz Göktürk <tomalok@gmail.com>

pkgname=runc
pkgdesc="CLI tool for spawning and running containers according to the OCI specification"
url="https://www.opencontainers.org"
_commit=51d5e94601ceffbbd85688df1c928ecccbfa4685
pkgver=1.1.12
pkgrel=2
arch="all"
license="Apache-2.0"
makedepends="bash go go-md2man libseccomp-dev libtool"
subpackages="$pkgname-doc"
source="https://github.com/opencontainers/runc/archive/v$pkgver/runc-$pkgver.tar.gz
	add-seccomp-for-loongarch64.patch
	"
options="!check"

provides="oci-runtime"
provider_priority=90

# secfixes:
#   1.1.12-r0:
#     - CVE-2024-21626
#   1.1.4-r0:
#     - CVE-2023-25809
#     - CVE-2023-27561
#     - CVE-2023-28642
#   1.1.4-r7:
#     - CVE-2023-27561
#   1.1.2-r0:
#     - CVE-2022-29162
#   1.0.3-r0:
#     - CVE-2021-43784
#   1.0.0_rc95-r0:
#     - CVE-2021-30465
#   1.0.0_rc10-r0:
#     - CVE-2019-19921
#   1.0.0_rc9-r0:
#     - CVE-2019-16884
#   1.0.0_rc7-r0:
#     - CVE-2019-5736

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make COMMIT="$_commit"
	make man
}

package() {
	install -Dsm755 runc "$pkgdir"/usr/bin/runc
	install -Dm644 "$builddir"/man/man8/* -t "$pkgdir"/usr/share/man/man8/
}

sha512sums="
92e8ac54a77d7ebcc76b5a9cc08d9a064211f12e9d26f064070cc203a5afb11c3af28d8f556f297513f797a2933d50bf10a8f22e307724041d66aa8c5ca1d9d3  runc-1.1.12.tar.gz
e2e468406557e93514fc4bc6c3e9f6a698175a2f2533417ccfe180ce668fb94a5d9b0519541ad22b0e9de7c817342943ee6774a3a920d3f4c3615e992cd95ea3  add-seccomp-for-loongarch64.patch
"
